package com.wdf.project03.Mapper;

import com.wdf.project03.pojo.Dept;
import com.wdf.project03.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select * from dept")
    public List<Dept> selectAll();
    @Select("select * from user")
    public List<User> list();
    @Delete("delete from dept where id = #{id}")
    public void deleteById(Integer id);

    public void insertDept(Dept dept);
    @Select("select * from dept where  id = #{id}")
    Dept selectById(Integer id);
    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id}")
    public void updateDept(Dept dept);
}
